NAND logic